import { debug } from 'webpack'
import { AppModel } from '../../../../model/AppModel'
import { createPartMenu } from '../BlockPackage'

declare var Vue : any


export default {

    category: Blockly.Categories.bepart ,
    
    color: [
        Blockly.Colours.bepart.primary,
        Blockly.Colours.bepart.secondary,
        Blockly.Colours.bepart.tertiary
    ] ,

    previousStatement: true ,
    nextStatement: true ,

    init(model:Model, scratch3:any) {
        this.appendDummyInput()
            .appendField("打包字符串")
        this.appendValueInput("data")
    } ,

    run (args: any, util: any, runtime: any, model: AppModel) {
    } ,

    coder: {
        JavaScript(block: any, coder: any, model: AppModel) {
            let data = coder.valueToCode(block, "data", coder.ORDER_ASSIGNMENT) || '""'
            return `${coder.indentString()}(${data}) ,\n`
        }
    }
}
